import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/home/Home.vue'

import Found from '../views/home/Found.vue'
import Video from '../views/home/Video.vue'
import SongList from '../views/home/SongList.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
    redirect: '/found',
    children: [
      {
        path: '/found',
        name: 'Found',
        component: Found
      },
      {
        path: '/video',
        name: 'Video',
        component: Video
      },
      {
        path: '/songlist',
        name: 'SongList',
        component: SongList
      }
    ]
  },
  {
    path: '/player',
    name: 'Player',
    component: () => import(/* webpackChunkName: "player" */ '../views/player/Player.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
